<?php
/*------------------------------------------------------------------------
 * channelAction.class.php 
 *
 * 频道栏目接口类
 * 	
 * Created on 2015-06-06
 *
 * Author: hwc123 <hwc123@139.com>
 * 
 * Copyright (c) 2015 http://www.qingtajiao.com All rights reserved.
 * ------------------------------------------------------------------------
 */
namespace Api\Controller;

class ChannelController extends CommonController{

	public function index(){
		$new_list = array();
		
		$where['status']    = 1;
		$where['is_delete'] = 0;
		$list = D('Channel')->where($where)->order('order_id,id')->select();
		foreach ($list as $rs) {
			$new_list[] = $this->filter_field($rs);
		}

		$data['list'] = $new_list;

		$this->success('获取数据成功！',$data);
	}
	protected function filter_field($data){
		$data['parent_name'] = D('Common')->get_field_val('Channel', $data['parentid']);
		$data['channel_id']  = $data['id'];
		unset($data['id']);
		
		return $data;
	}
}